#ifndef _libdbus_cpp_exception_h_
#define _libdbus_cpp_exception_h_

#include <exception>
#include <string>

extern "C" {
#include <dbus/dbus.h>
} // extern "C"

namespace dbus {

class Exception : public std::exception {
protected:
	std::string m_what;
public:
	explicit Exception(const std::string& txt) : m_what(txt) {}
	explicit Exception(const DBusError& e) : m_what((std::string(e.name)+": "+e.message)) { }
	virtual const char* what() const throw () {return m_what.c_str();}
	virtual ~Exception() throw () {}
};

} // namespace dbus


#endif // _libdbus_cpp_exception_h_
